package org.example.api;

import org.example.domain.UserDomain;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "user-service", path = "/api/v1" )
public interface UserFeignClient {

    @GetMapping("/users/{uid}")
    UserDomain getUserById(@PathVariable("uid") Integer uid);

    @PostMapping("/users/{uid}")
    Boolean insertUser(@PathVariable("uid") Integer uid, @RequestBody UserDomain user);

}
